class Solution
{
public:
    bool areOccurrencesEqual(string s)
    {
        unordered_map<char, int> count;
        for (char c : s)
        {
            ++count[c];
        }
        int eachCount = count.begin()->second;
        for (auto &[_, cnt] : count)
        {
            if (cnt != eachCount)
            {
                return false;
            }
        }
        return true;
    }
};